package com.example.ds.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.ds.base.BaseController;
import com.example.ds.entity.AccountInfo;
import com.example.ds.service.IAccountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author 姚勇
 */
@RequestMapping("/accountInfo")
@RestController
public class AccountInfoController extends BaseController<AccountInfo, IAccountInfoService> {

    @Autowired
    private IAccountInfoService accountInfoService;


    /**
     * 查询平台列表
     *
     * @return
     */
    @GetMapping("/listPlatform")
    public List listPlatform() {
        QueryWrapper<AccountInfo> wrapper = super.getQueryWrapper(null);
        wrapper.select("platform").groupBy("platform");
        List<Map<String, Object>> list = accountInfoService.listMaps(wrapper);
        return list;
    }

}
